<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
 <link rel="stylesheet" href="../static/css/back/font.css">
 <link rel="stylesheet" href="../static/css/back/role.css">
    <link rel="stylesheet" href="../static/css/back/xadmin.css">
    <script type="text/javascript" src="../static/js/jquery-2.1.1.min.js"></script>
    
    <script type="text/javascript" src="../static/js/back/xadmin.js"></script>
    <script type="text/javascript" src="../static/js/back/ajax.js"></script>
    <script type="text/javascript" src="../static/js/back/utils.js"></script>
<!--      <script type="text/javascript" src="../static/js/back/shop-trans-list.js"></script> -->
   
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
<style type="text/css">
.td-ms span {
	float: right;
	text-align: center; line-height : 38px;
	margin-right: 15px;
	line-height: 38px;
}
td{
	border-width: 0 !important;
}
</style>
</head>
  
  
  
  <body>
    <div class="x-body">
        <form action="" method="post" class="layui-form" lay-filter="formAdd">
                <div class="layui-form-item">
                    <label for="name" class="layui-form-label">
                        	平台客服电话
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="name" name="platPhone" required="" lay-verify="" placeholder="请输入平台电话"
                        autocomplete="off" class="layui-input">
                    </div>
                   <div class="layui-form-mid layui-word-aux black">
					</div>
                </div>
                <div class="layui-form-item">
                    <label for="name" class="layui-form-label">
                        	店铺范围设置
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="name" name="distance" required="" lay-verify="" placeholder="请输入距离"
                        autocomplete="off" class="layui-input">
                    </div>
                   <div class="layui-form-mid layui-word-aux black">
						km
					</div>
                </div>
			
		   <div class="layui-form-item">
				<label class="layui-form-label"></label>
                   <div class="layui-form-mid layui-word-aux bottom-next">
					注：若设置10000米,则商家列表只显示商家离用户10000米范围内的商家,不填或填零则全部显示
				</div>
			</div>
		   <div class="layui-form-item">
				<label class="layui-form-label">商家入驻费用</label>
				<div class="layui-input-inline">
					<table class="layui-table" style="width: 650px;">
                  <thead>
                    <tr>
                      <th>美食</th>
                      <th>超市</th>
                      </tr>
                  </thead>
                  <tbody>
                  <tr>
                    <td>
	                    <div class="td-ms"> 
	                     	<span>天</span>
	                     	<span> 
	                     		<input type="text" id="name" name="freeDay1" style="width: 150px;" required="" lay-verify="" placeholder="请输入提现手续费"
	                       			 autocomplete="off" class="layui-input">
	                        </span>
	                     	<span>免费体验</span>
	                    </div>
                    </td>
                    <td>
	                    <div class="td-ms"> 
	                     	<span>天</span>
	                     	<span> 
	                     		<input type="text" id="name" name="freeDay2" style="width: 150px;" required="" lay-verify="" placeholder="请输入提现手续费"
	                       			 autocomplete="off" class="layui-input">
	                        </span>
	                     	<span>免费体验</span>
	                    </div>
                    </td>
                  </tr>
                  <tr>
                    <td>
	                    <div class="td-ms"> 
	                     	<span>元</span>
	                     	<span> 
	                     		<input type="text" id="name" name="firstYear1" style="width: 150px;" required="" lay-verify="" placeholder="请输入提现手续费"
	                       			 autocomplete="off" class="layui-input">
	                        </span>
	                     	<span>第一次年费</span>
	                    </div>
                    </td>
                    <td>
	                    <div class="td-ms"> 
	                     	<span>元</span>
	                     	<span> 
	                     		<input type="text" id="name" name="firstYear2" style="width: 150px;" required="" lay-verify="" placeholder="请输入提现手续费"
	                       			 autocomplete="off" class="layui-input">
	                        </span>
	                     	<span>第一次年费</span>
	                    </div>
                    </td>
                  </tr>
                  <tr>
                    <td>
	                    <div class="td-ms"> 
	                     	<span>元</span>
	                     	<span> 
	                     		<input type="text" id="name" name="nextYear1" style="width: 150px;" required="" lay-verify="" placeholder="请输入提现手续费"
	                       			 autocomplete="off" class="layui-input">
	                        </span>
	                     	<span>续费年费</span>
	                    </div>
                    </td>
                    <td>
	                    <div class="td-ms"> 
	                     	<span>元</span>
	                     	<span> 
	                     		<input type="text" id="name" name="nextYear2" style="width: 150px;" required="" lay-verify="" placeholder="请输入提现手续费"
	                       			 autocomplete="off" class="layui-input">
	                        </span>
	                     	<span>续费年费</span>
	                    </div>
                    </td>
                  </tr>
                  </tbody>
              </table>
				</div>
			</div>
		   <div class="layui-form-item">
				<label class="layui-form-label"></label>
               		 <button class="layui-btn" lay-submit=""  data-type="content" lay-filter="add">保存</button>
               		 <button type="reset" class="layui-btn layui-btn-primary">重置</button>
              	</div>
            </form>
    </div>
    <script>
    _showData = null;
        layui.use(['form','layer','layedit'], function(){
            $ = layui.jquery,
         form = layui.form,
         layer = layui.layer;
        	
          //自定义验证规则
          form.verify({
            nikename: function(value){
              if(value.length < 5){
                return '昵称至少得5个字符啊';
              }
            }
            ,pass: [/(.+){6,12}$/, '密码必须6到12位']
            ,repass: function(value){
                if($('#L_pass').val()!=$('#L_repass').val()){
                    return '两次密码不一致';
                }
            }
          });
			
          //监听提交
          form.on('submit(add)', function(data){
				console.log(data.field);
				updateInfo(data.field);
				return false;
          });
          
          _ajax_post_token('../sys/getSysSet',{},function(res){
        	  console.log(res);
	          console.log(_showData);
	          var ddd = res.returnObject;
	          ddd.nextYear1 = (ddd.nextYear1 / 100.0 )
	          ddd.nextYear2 = (ddd.nextYear2 / 100.0 )
	          ddd.firstYear1 = (ddd.firstYear1 / 100.0 )
	          ddd.firstYear2 = (ddd.firstYear2 / 100.0 )
	          form.val("formAdd", ddd);
          });
          
        });
        function updateInfo(d){
        	d.nextYear1 = (d.nextYear1 * 100 ).toFixed(0);
	          d.nextYear2 = (d.nextYear2 * 100 ).toFixed(0);
	          d.firstYear1 = (d.firstYear1 * 100 ).toFixed(0);
	          d.firstYear2 = (d.firstYear2 * 100 ).toFixed(0);
        	_ajax_post_token('../sys/addSysSet.do',d,function(res){
        		console.log(res);
        		if(res.resultCode==1000){
        			layer.msg('保存成功!',{icon:6,time:2000});
        		}else{
        			layer.msg('保存失败!',{icon:6,time:2000});
        		}
        	})
        }
    </script>

  </body>

</html>